Eclipse Platform
Pre-release 3.0

org.eclipse.ui.progress
Class DeferredTreeContentManager

java.lang.Object
  extended byorg.eclipse.ui.progress.DeferredTreeContentManager

public class DeferredTreeContentManager
extends Object

The DeferredContentManager is a class that helps an ITreeContentProvider get its deferred input.

Since:
3.0
See Also:
IDeferredWorkbenchAdapter

Constructor Summary
DeferredTreeContentManager(ITreeContentProvider provider, AbstractTreeViewer viewer)
          Create a new instance of the receiver using the supplied content provider and viewer.
 
Method Summary
 void cancel(Object parent)
          Cancel all jobs that are fetching content for the given parent or any of its children.
 Object[] getChildren(Object parent)
          Returns the child elements of the given element, or in the case of a deferred element, returns a placeholder.
 boolean isDeferredAdapter(Object element)
          Return whether or not the element is or adapts to an IDeferredWorkbenchAdapter.
 boolean mayHaveChildren(Object element)
          Provides an optimized lookup for determining if an element has children.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeferredTreeContentManager

public DeferredTreeContentManager(ITreeContentProvider provider,
                                  AbstractTreeViewer viewer)
Create a new instance of the receiver using the supplied content provider and viewer.

Parameters:
provider -
viewer -
Method Detail

mayHaveChildren

public boolean mayHaveChildren(Object element)
Provides an optimized lookup for determining if an element has children. This is required because elements that are populated lazilly can't answer getChildren just to determine the potential for children. Throw an AssertionFailedException if element is not an instance of IDeferredWorkbenchAdapter.

Parameters:
element - Object
Returns:
boolean

getChildren

public Object[] getChildren(Object parent)
Returns the child elements of the given element, or in the case of a deferred element, returns a placeholder. If a deferred element used a job is created to fetch the children in the background.

Parameters:
parent - The parent object.
Returns:
Object[] or null if parent is not an instance of IDeferredWorkbenchAdapter.

isDeferredAdapter

public boolean isDeferredAdapter(Object element)
Return whether or not the element is or adapts to an IDeferredWorkbenchAdapter.

Parameters:
element -
Returns:
boolean true if the element is an IDeferredWorkbenchAdapter

cancel

public void cancel(Object parent)
Cancel all jobs that are fetching content for the given parent or any of its children.

Parameters:
parent -

Eclipse Platform
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.